package learnjava.concur.chapter123;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class TestSleep {

    static final Logger logger = LoggerFactory.getLogger(TestSleep.class);

    public static void main(String[] args) throws Exception {

        Thread t1 = new Thread("t1"){
            @Override
            public void run() {
                logger.info("t1 start");
                try {
                    Thread.sleep(2000);
                } catch (InterruptedException e) {
                    logger.info("weak up");
                    e.printStackTrace();
                }
            }
        };
        t1.start();

        Thread.sleep(1000);
        logger.info("interrupt...");
        t1.interrupt();
    }
}
